﻿using System;
using WF_AppFuel.Validation.Base;
using WF_AppFuel.Validation.Engines;

namespace WF_AppFuel.Validation.Attributes
{
    public sealed class IsAlphaNumeric : BaseValidationAttribute
    {
        private bool isWhiteSpaceAllowed = false;

        public IsAlphaNumeric(bool isWhiteSpaceAllowed)
        {
            this.isWhiteSpaceAllowed = isWhiteSpaceAllowed;
            this.SetValidationMessage("Must Contain Letters and Numbers Only");
        }

        public override Type ValidationEngineType
        {
            get { return typeof(IsAlphaNumericValidationEngine); }
        }

        public bool IsWhiteSpaceAllowed { get { return this.isWhiteSpaceAllowed; } }
    }
}
